﻿<!DOCTYPE html>
<html  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <link th:href="@{/administration/css/reset.css}" rel="stylesheet" />
    <link th:href="@{/administration/css/iconfont.css}" rel="stylesheet" />
    <link th:href="@{/administration/css/index.css}" rel="stylesheet" />
    <script th:src="@{/administration/js/jquery-1.9.1.min.js}"></script>
    <script th:src="@{/administration/js/f.js}"></script>

    <script type="text/javascript">
        $(document).ready(function() {
            $("#query").css("color","white");
            //实现全选
            $("#inputcheck").click(function () {
                // this 全选的复选框
                var userids = this.checked;
                //获取name=box的复选框 遍历输出复选框
                $("input[name=box]").each(function () {
                    this.checked = userids;
                });
            });
            //批量删除
            $("#deletes").click(function () {
                var delSize = $("[name=box]:checked").size();
                var OrderName_list = []
                var OrderNames='';
                $("[name=box]:checked").each(function () {
                    OrderName_list.push($(this).val())
                    OrderNames+=$(this).val()+",";
                });
                $.post("/OrdersDelete",
                    {OrderNames:OrderNames},
                    function (data) {
                        for ( var i=0;i<delSize;i++){
                            var  OrderName=OrderName_list[i];
                            $("[id="+OrderName + "]").parent().parent().remove();
                        }
                    }
                );
            })
        });
    </script>
    <title>订单管理</title>
</head>
<body>
    <div class="PublicHead clearfix">
        <div class="leftBox clearfix">
            <div class="companyLogo">
                 <img th:src="@{/administration/images/logo.jpg}" />
            </div>
            <!--<i class="iconfont icon-caidan"></i>-->

            <div class="companyText">
                后台订单管理
            </div>
        </div>
        <div class="RightBox clearfix">
            <div class="UserPhotoBox">
                <div class="UserPic">
                     <img th:src="@{/administration/images/user.jpg}" />
                </div>
                <div class="UserName">
                    [[${uName}]]
                </div>
            </div>
            <a href="/Signout">
                <div class="dropOutBox">
                    <i class="iconfont icon-app_icons--">
                    </i>
                    <span>退出</span>
                </div>
            </a>
        </div>
    </div>

    <div class="PublicDownWhole clearfix">
        <!--左侧-->
        <div class="leftBox">
            <ul>
                <a th:href="@{/toUserManagement}"> <li class=""><i class="iconfont icon-yonghuguanli"></i><span>用户管理</span></li></a>
                <a th:href="@{/toOrderManagement}">
                    <li class="Select"><i class="iconfont icon-tubiao_dingdan"></i><span>订单管理</span></li>
                </a>
            </ul>
        </div>
        <!--右侧-->
        <div class="RightBox">
            <div class="PublicContentBox">
                <!--公用指向页面名字-->
                <div class="PublicPointToAgeText">
                    <span class="span1">订单管理 </span> <span class="span2">后台订单管理列表</span>
                </div>
                <!--查询-->
                <div class="InquireBox clearfix">
                    <form th:action="@{/OrderQuery}">
                        <div class="InquireleftBox">
                            <div class="Text">订单号：</div>
                            <div class="InputDiv"><input class="phoneInput" name="orderNumber" placeholder="请输入你需要查询的订单号"/></div>
                        </div>
                        <div class="InquireleftBox">
                            <div class="Text">真实姓名：</div>
                            <div class="InputDiv"><input class="phoneInput" name="rname" placeholder="请输入你需要查询的真实姓名"/></div>
                        </div>
                        <div class="InquireleftBox">
                            <div class="Text">入住酒店：</div>
                            <div class="InputDiv"><input class="phoneInput" name="hotelName" placeholder="请输入你需要查询的入住酒店"/></div>
                        </div>
                        <div class="PublicBtnIcon Color1Btn fr">
                            <i class="iconfont icon-icon-chaxun"></i>
                            <input type="submit" id="query" value="查询">
                        </div>
                    </form>
                </div>
                <!--批量删除-->
                <div class="InquireTableBox">
                    <div class="headbox">
                        <div class="headboxtext">
                            <span class="span1">后台订单管理列表</span>
                        </div>
                        <!--批量删除-->
                        <div class="PublicBtnIcon Color5Btn">
                            <a id="deletes">
                                <i class="iconfont  icon-shanchu"></i>
                                <span>批量删除</span>
                            </a>
                        </div>

                    </div>

                    <!--查询到的表格-->

                    <div class="InquireSelectTable">
                        <table class="PublicTableCss">
                            <thead>
                                <tr>
                                    <td>
                                        <input id="inputcheck" class="inputcheck" type="checkbox" name="inputcheck" />
                                        <label for="inputcheck"></label>
                                        <span>全选</span>
                                    </td>
                                    <td>订单ID</td>
                                    <td>用户名</td>
                                    <td>姓名</td>
                                    <td>手机号</td>
                                    <td>入住酒店</td>
                                    <td>房间类型</td>
                                    <td>房间数</td>
                                    <td>应付金额</td>
                                    <td>下单时间</td>
                                    <td>订单状态</td>
                                    <td>操作</td>
                                </tr>

                            </thead>
                            <tbody>
                                <tr th:each="Order:${OrderList}">
                                    <td>
                                        <input th:attr="id=${Order.getOrderNumber()}" class="inputcheck"  type="checkbox" name="box" th:value="${Order.getOrderNumber()}"/>
                                        <label th:attr="for=${Order.getOrderNumber()}"></label>
                                    </td>
                                    <td th:text="${Order.getOrderNumber()}"></td>
                                    <td th:text="${Order.getuName()}"></td>
                                    <td th:text="${Order.getRname()}"></td>
                                    <td th:text="${Order.getPhone()}"></td>
                                    <td th:text="${Order.getHotelName()}"></td>
                                    <td th:text="${Order.getRtypeId()}"></td>
                                    <td th:text="${Order.getRoomCount()}"></td>
                                    <td th:text="${Order.getPrice()}+元"></td>
                                    <td th:text="${Order.getOrderTime()}"></td>
                                    <td th:text="${Order.getOrderState()}" name="State" id="OrderState" th:attr="class=${Order.getOrderNumber()}"></td>
                                    <td id="operation">

                                        <div class="PublicTableBtnIcon Color3Btn Js_Orderupdat">
                                            <i class="iconfont icon-tubiaozhizuomobanyihuifu-"></i>
                                            <input type="hidden" id="UpdateOrder" th:value="${Order.getOrderNumber()}">
                                            <span>编辑</span>
                                        </div>

                                        <div class="PublicTableBtnIcon Color4Btn Js_Orderdelete">
                                            <i class="iconfont icon-shanchu"></i>
                                            <input type="hidden" id="DeleteOrder" th:value="${Order.getOrderNumber()}">
                                            <span>删除</span>
                                        </div>
                                        <div class="PublicTableBtnIcon Color0Btn Js_refund ">
                                            <i class="iconfont icon-toBottom"></i>
                                            <input type="hidden" id="Orderrefund" th:value="${Order.getOrderNumber()}">
                                            <input type="hidden" id="OrderPrice" th:value="${Order.getPrice()}">
                                            <span>同意退款</span>
                                        </div>
                                    </td>
                                </tr>

                            </tbody>
                        </table>

                    </div>
                    <!--分页-->
              <!--      <div class="PageNumber">
                        <div class="NumbersBox">
                            <div class="LeftArrow">
                                上一页
                            </div>
                            <ul>
                                <li class="Select">1</li>
                                <li class="">2</li>
                                <li class="">...</li>
                                <li class="">4</li>
                                <li class="">5</li>
                            </ul>
                            <div class="RightArrow ">
                                下一页
                            </div>
                        </div>
                    </div>-->


                </div>
            </div>

        </div>
    </div>


    <!--&lt;!&ndash; alert通用 提示是否删除&ndash;&gt;
    <div class="PublicFloatBox f_delete">
        <div class="f_MiddleBox wid260">
            <div class="f_Head">
                <span>提示消息</span>
                <i class="Js_closeBtn iconfont icon-buoumaotubiao20 fr"></i>
            </div>
            <div class="f_content clearfix">
                &lt;!&ndash;提示消息内容&ndash;&gt;
                <div class="f_someText">
                    <i class="iconfont icon-tishi"></i>
                    <span>确定删除此信息？</span>
                </div>
                &lt;!&ndash;按钮&ndash;&gt;
                <div class="f_pormatBtn  clearfix">
                    <div class="f_pormatBtn1">
                        确定
                    </div>
                    <div class="f_pormatBtn2">
                        删除
                    </div>
                </div>
            </div>
        </div>
    </div>-->
    <!--修改订单状态-->
    <div class="PublicFloatBox Updateorder">
        <div class="f_MiddleBox wid400">
            <div class="f_Head">
                <span>修改订单状态-</span>
                <i class="Js_OrdercloseBtn iconfont icon-buoumaotubiao20 fr"></i>
            </div>

            <div class="f_content">
                <form th:action="@{/updateState}">
                    <div class="f_alonediv">
                        <div class="f_alone_name">
                            订单ID:
                        </div>
                        <div class="f_alone_input">
                            <input id="updateorderNumber" name="orderNumber" class="f_p_input" readonly="readonly" />
                        </div>
                    </div>

                    <div class="f_alonediv">
                        <div class="f_alone_name">
                            订单状态：
                        </div>
                        <div class="f_alone_input">
                            <select id="updateOrderState" name="orderState">
                                <option >请修改订单状态</option>

                                <option value="已支付" >已支付</option>

                                <option value="申请退款" >申请退款</option>

                                <option value="已退款" >已退款</option>

                            </select>

                        </div>

                    </div>


                    <div class="f_alonediv1">
                        <div class="f_alone_name">
                        </div>
                        <div class="f_alone_input1">
                            <!--publicbtn-->
                            <div class="publicf_btn">
                                <div class="publicf_btn1" >
                                    <input type="submit" th:value="确定">
                                </div>
                                <div class="publicf_btn2 fr Js_OrdercloseBtn">
                                    <input type="reset" th:value="取消">
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>

        </div>
    </div>
</body>
</html>